package com.ly.count.config;

import com.ly.count.interceptor.CPlusLoginInterceptor;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import static com.ly.count.CPlusConstants.CPLUS_INTERFACE_FOR_WEB;

@Configuration
public class CPlusWebConfig implements WebMvcConfigurer {
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new CPlusLoginInterceptor()).addPathPatterns(CPLUS_INTERFACE_FOR_WEB + "/**").excludePathPatterns(new String[]{"**/login", "**/loginOut"});
    }
}